package expertSystem;

import java.util.ArrayList;

import service.Dictionary;

public class KnowledgeBase implements IKnowledgeBase
{
	Dictionary<KnowledgeType,ArrayList<Knowledge>> base;
	//===========================================================================
	public KnowledgeBase()
	{
		base = new Dictionary<KnowledgeType, ArrayList<Knowledge>>();
	}
	//===========================================================================
	@Override
	public ArrayList<Knowledge> Get(KnowledgeType type) 
	{
		if(base.containsKey(type))
		{
			return base.Get(type);
		}
		return null;
	}
	//===========================================================================
	@Override
	public void Add(KnowledgeType type, Knowledge K) 
	{
		if(!base.containsKey(type))
		{
			base.Add(type, new ArrayList<Knowledge>());
		}
		base.Get(type).add(K);		
	}
}
